package com.bjsxt.service.impl;

import com.bjsxt.mapper.HostPowerMapper;
import com.bjsxt.pojo.HostPower;
import com.bjsxt.service.HostPowerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class HostPowerServiceImpl implements HostPowerService {

    @Autowired
    private HostPowerMapper hostPowerMapper;
    @Override
    public Integer changeHostPower(HostPower hostPower, Integer[] hostids) {
        int a=0;
        try {
            for (Integer hostid:hostids){
                hostPower.setHostid(hostid);
                hostPowerMapper.updateHostPower(hostPower);
            }
            a=1;
        } catch (Exception e) {
            throw e;
        }
        return a;
    }
}
